﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DTO;
using DAO;

namespace BUS
{
    public class DocGiaBUS
    {
        #region 1. Them
        public static bool ThemDocGia(DocGiaDTO docgia){
            if (!LoaiDocGiaDAO.CheckLoaiDGByID(docgia.MaLoaiDG))
            {
                return false;
            }
            return DocGiaDAO.ThemDocGia(docgia);
        }
        #endregion
        #region 2. Sua
        public static bool SuaDocGia(DocGiaDTO docgia)
        {
            if (!LoaiDocGiaDAO.CheckLoaiDGByID(docgia.MaLoaiDG))
            {
                return false;
            }
            return DocGiaDAO.SuaDocGia(docgia);
        }
        #endregion
        #region 3. Xoa
        public static bool XoaDocGia(String sothe)
        {
            return DocGiaDAO.XoaDocGia(sothe);
        }
        #endregion
        #region 4. Tim kiem
        public static DocGiaDTO TimDocGia(String sothe){
            return DocGiaDAO.TimDocGia(sothe);
        }
        public static DataTable TimTatCaDocGia(){
            return DocGiaDAO.TimTatCaDocGia();
        }
        public static List<DocGiaDTO> TimDocGiaByLoaiDG(String maloaidg){
            return DocGiaDAO.TimDocGiaByLoaiDG(maloaidg);
        }
        #endregion
    }
}
